﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.IO.Compression;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.ServiceModel;
using ZgOffice.Client.DelegateEvent;
using ZgOffice.Services;
using Common;

namespace ZgOffice.Client.UserForms
{
    public partial class TabListViewFrm : Form
    {
        public TabListViewFrm()
        {
            InitializeComponent();
            gridView1.OptionsView.ColumnAutoWidth = false;
        }
        public void FillDataToView(DataSet ds)
        {
            gridView1.Columns.Clear();
            gridControl1.DataSource = ds.Tables[0];
        }
        public void FillDataToView(string tableName)
        {
            try
            {
                gridView1.Columns.Clear();//清除控件列，不然后续的绑定切换时，显示界面不会改变的。
                OfficeServiceClient client = new OfficeServiceClient(Program.bind, Program.address);
                DataSet ds = client.ReadDIYTable(tableName);
                gridControl1.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
